//===================================
//File: Tube.cpp
//Tube functions
//Name: Smirnova O.P.
//Date: 28.06.12, v.1.0
//===================================
#include "Tube.h"
unsigned int Tube::count=0;
unsigned int Tube::count_all=0;
//---------------------------------------------------------------------------

using namespace std;

Tube::Tube()
{
	count_all++;
    id=count_all;
	count++;
	tl = Point(0,0,1);
	w=0;
	h=0;
};

Tube::Tube(Point tl,int w,int h)
{
	count_all++;
    id=count_all;
	count++;
 //cout << "\nTube():\n";
 this->tl = tl;
 this->w = w;
 this->h = h;
 //cout << "Tube()\n";
};

Tube::~Tube()
{
	//cout << "\n~Tube:\n";
	//cout << "~Tube\n";
};

//Вывод на экран
void Tube::write() {
    cout << "Self ID: "<<id<<endl;
	cout << "TopLeft point = " << tl << endl;
	cout << "Width =" << w << " Height =" << h << endl;
}

void Tube::moveTo (Point p)
{
	tl.moveToPoint(p);

};

void Tube::moveTodXdY (double x, double y)
	{

	tl.moveTodXdY(x,y);
};

void Tube::consST (Point p)
	{

		tl.consSP(p);
	};

//---------------------------------------------------------------------------
const unsigned int Tube::getID()
{
  return id;
};
//---------------------------------------------------------------------------
unsigned int Tube::countObject()
{
  return count; 
};

int Tube::getWidth()
{
	return w;	
}
int Tube::getHeight()
{
	return h;	
}
Point Tube::getPoint()
{
	return tl;
}
